<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Installing the MongoDB PHP Driver on Windows</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongodb.installation.homebrew.html">« Installing the MongoDB PHP Driver on macOS with Homebrew</a></li>
      <li style="float: right;"><a href="mongodb.installation.manual.html">Building the MongoDB PHP Driver from source »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="mongodb.installation.html">安装</a></li>
    <li>Installing the MongoDB PHP Driver on Windows</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongodb.installation.windows" class="section">
  <h2 class="title">Installing the MongoDB PHP Driver on Windows</h2>

  <p class="para">
   Precompiled binaries for each release are available from
   <a href="https://pecl.php.net/package/mongodb" class="link external">&raquo;&nbsp;PECL</a> for a variety of
   combinations of versions, thread safety, and VC libraries. Extract the
   archive and put <var class="filename">php_mongodb.dll</var> in your PHP extension
   directory (&quot;ext&quot; by default).
  </p>

  <p class="para">
   Add the following line to the <var class="filename">php.ini</var> file for each environment in which
   you intend to use the driver:
   <div class="example-contents">
<div class="inicode"><pre class="inicode">extension=php_mongodb.dll</pre>
</div>
   </div>

  </p>

  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <strong>Additional DLL dependencies for Windows Users</strong><br />
   <p class="para">
    为了使此扩展生效，
<abbr title="Dynamic Link Library">DLL</abbr> 文件必须能在 Windows 系统的
<var class="envar">PATH</var> 指示的路径下找到。如何操作的信息，请参见题为“<a href="faq.installation.html#faq.installation.addtopath" class="link">如何在 Windows 中将 PHP
目录加到 PATH 中</a>”的<abbr title="Frequently Asked Questions">FAQ</abbr>。虽然将
DLL 文件从 PHP 文件夹复制到 Windows 系统目录也行，但不建议这样做。
<em class="emphasis">此扩展需要下列文件在 <var class="envar">PATH</var> 路径中：</em>
    <var class="filename">libsasl.dll</var>
   </p>
  </p></blockquote>
 </div></div></div></body></html>